<route lang="json5" type="page">
  {
    style: {
      navigationBarTitleText: '退课订单',
    },
    anonymous: false
  }
</route>

<script lang="ts" setup>
import RefundOrderItem from './components/RefundOrderItem.vue'
import { OrderApi } from '@/apis'
import { useUserStore } from '@/stores'

const userStore = useUserStore()

const list = ref([])

const getList = async () => {
  const query: OrderApi.RefundQuery = {
    studentId: userStore.currentStudent.id,
  }
  const res = await OrderApi.getRefundPage(query)
  list.value = res || []
}

onLoad(() => {
  getList()
})
</script>

<template>
  <view class="p-[30rpx]">
    <view v-for="(item, index) in list" :key="item" class="mt-[24rpx]" :style="index === 0 ? 'margin-top:0' : ''">
      <RefundOrderItem :data="item" />
    </view>
    <view v-if="!list.length">
      <wd-status-tip image="content" tip="暂无订单" />
    </view>
  </view>
</template>

<style lang="scss" scoped>

</style>
